#pragma once
/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework Class Library
 * Version 2.00
 * 
 * Socket Error Event Arguments Class
 *      Provides an event arguments class for new socket exception events.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
#include "stdafx.h"
#include "ConnectionEventArgs.h"

using namespace System;

namespace Adaptive
{
	namespace Network
	{
		namespace Sockets
		{
			/// <summary>
			/// Provides an event arguments class for new socket exception events.
			/// </summary>
			/// <remarks>
			/// This is used with events where connection object instances are passed, such as 
			/// new connection events, allowing the reciever of the event to cancel the 
			/// connection if desired.
			/// </remarks>
			public ref class SocketErrorEventArgs : public System::EventArgs
			{
			public:
				/*--------------------------------------------------------------------------------
				 * Constructor / Dispose / Destructor Methods
				 *------------------------------------------------------------------------------*/
				#pragma region Constructor / Dispose / Destructor Methods
				/// <summary>
				/// Initializes a new instance of the class
				/// </summary>
				/// <param name="socketException">
				/// The exception which caused the event to be raised.
				/// </param>
				SocketErrorEventArgs(Exception^ socketException);
				/// <summary>
				/// Class destructor.
				/// </summary>
				~SocketErrorEventArgs();
				#pragma endregion
				
				/*--------------------------------------------------------------------------------
				 * Public Properties
				 *------------------------------------------------------------------------------*/
				#pragma region Public Properties
				/// <summary>
				/// Gets the reference to the socket exception that caused the event.
				/// </summary>
				/// <value>
				/// An <see cref="Exception"/> instance.
				/// </value>
				property Exception^ SocketException { Exception^ get(); }
				#pragma endregion

			private:
				/*--------------------------------------------------------------------------------
				 * Private Member Declarations
				 *------------------------------------------------------------------------------*/
				#pragma region Private Member Declarations

				Exception^		_exception;

				#pragma endregion

			};
		}
	}
}
